const {
    override,
    // addDecoratorsLegacy,
    disableEsLint,
    // addBundleVisualizer,
    addWebpackAlias,
    // adjustWorkbox
} = require("customize-cra");

// node讲过 该模块是用来操作文件路径的
const path = require("path");

module.exports = override(
    // enable legacy decorators babel plugin
    // addDecoratorsLegacy(),

    // disable eslint in webpack
    disableEsLint(),

    // add webpack bundle visualizer if BUNDLE_VISUALIZE flag is enabled
    // process.env.BUNDLE_VISUALIZE == 1 && addBundleVisualizer(),

    // add an alias for "ag-grid-react" imports

    // 配置快捷路径符
    addWebpackAlias({
        ["@"]: path.resolve(__dirname, "src")
    }),

    // adjust the underlying workbox
    /* adjustWorkbox(wb =>
        Object.assign(wb, {
            skipWaiting: true,
            exclude: (wb.exclude || []).concat("index.html")
        })
    ) */
);